package com.bestv.datalake.service;

import com.bestv.datalake.mapper.LogHashMapper;
import com.bestv.datalake.model.LogHash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by jing.zigao on 2016/5/25.
 */
@Service
public class LogHashService {

    @Autowired
    private LogHashMapper LogHashMapper;

    public LogHash getLogHashBySubject(String subject){
        LogHash lp = LogHashMapper.getLogHashBySubject(subject);
        return lp;
    }

    public List<LogHash> getAllLogHashs(){
        return LogHashMapper.getAllLogHashs();
    }

    public LogHash getLogHashByLogHashId(long logHashId){
        return LogHashMapper.getLogHashById(logHashId);
    }

    public void createLogHash(LogHash logHash){
         LogHashMapper.addLogHash(logHash);
    }

    public void updateLogHash(LogHash logHash){
         LogHashMapper.updateLogHash(logHash);
    }

    public String deleteLogHash(LogHash logHash){
        LogHashMapper.deleteLogHash(logHash);
        return "deleted!";
    }

    public String deleteLogHash(long logHashId){
        LogHashMapper.deleteLogHashById(logHashId);
        return "deleted!";
    }
}
